/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package br.com.foxline.manager.search;

import br.com.foxline.model.City;
import br.com.foxline.service.CityService;
import java.util.ArrayList;
import java.util.List;
import javax.annotation.PostConstruct;
import javax.ejb.EJB;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.ViewScoped;

/**
 *
 * @author ely
 */
@ViewScoped
@ManagedBean
public class ManagerSearchCity {

    @EJB
    CityService cityService;
    
    private City city; 
    private List<City> citys;

    public ManagerSearchCity() {
    }

    @PostConstruct
    public void init() {
        city = new City();
        citys = new ArrayList<City>();
    }

    
    public void searchCity(){
        System.out.println("CHGOU "); 
        citys = cityService.findCity(city);
    } 
    

    public City getCity() {
        return city;
    }

    public void setCity(City city) {
        this.city = city;
    }

    public List<City> getCitys() {
        return citys;
    }

    public void setCitys(List<City> citys) {
        this.citys = citys;
    }
}
